﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Foolproof;
using TSharp.Core.AppBox.Models;

namespace TSharp.Core.AppBox.Areas.Admin.Models
{
    //[PropertiesMustMatch("Password", "ConfirmPassword", ErrorMessage = "密码和确认密码不匹配。")]
    public class User
    {
        [Required]
        [DisplayName("用户名")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.EmailAddress)]
        [DisplayName("电子邮件地址")]
        public string Email { get; set; }

        [Required]
        [ValidatePasswordLength]
        [DataType(DataType.Password)]
        [DisplayName("密码")]
        public string Password { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [DisplayName("确认密码")]
        [EqualTo("Password", ErrorMessage = "确认密码不正确")]
        public string ConfirmPassword { get; set; }
        [Required]
        [DataType(DataType.DateTime)]
        [DisplayName("生日")]
        public DateTime BorthDay { get; set; }

        public static User Default = new User()
                    {
                        UserName = "admin",
                        Password = "123456",
                        ConfirmPassword = "123456",
                        Email = "tangjingbo@foxmail.com"
                    };
    }
}